Skip to content

Conversation

@jbcaillau
Copy link
Member

  • CTParser v0.8 integration tests
  • check src/exa_linalg.jl (type piracy)

@github-actions github-actions bot requested a review from ocots January 15, 2026 17:25
@github-actions
Copy link
Contributor

github-actions bot commented Jan 15, 2026

Breakage test results
Date: 2026-01-15 18:04:42

Name Latest Stable
OptimalControlProblems
Tutorials

@jbcaillau
Copy link
Member Author

@ocots 🙂

julia> using OptimalControl

julia> using OptimalControl.ExaLinAlg

julia> using MadNLPMumps

julia> t0 = 0
0

julia> tf = 1
1

julia> x0 = [-1, 0]
x2-element Vector{Int64}:
 -1
  0

julia> xf = [0, 0]
2-element Vector{Int64}:
 0
 0

julia> A = [0 1; 0 0]
2×2 Matrix{Int64}:
 0  1
 0  0

julia> b = [0, 1]
2-element Vector{Int64}:
 0
 1

julia> o = @def begin
           t  [t0, tf], time
           x  R², state
           u  R, control
           x(t0) == x0
           x(tf) == xf
           (t) == A * x(t) + u(t) * b
           0.5( u(t)^2 )  min
       end
solAbstract definition:

    t  [t0, tf], time
    x  R², state
    u  R, control
    x(t0) == x0
    x(tf) == xf
    (t) == A * x(t) + u(t) * b
    0.5 * (u(t) ^ 2)  min

The (autonomous) optimal control problem is of the form:

    minimize  J(x, u) =f⁰(x(t), u(t)) dt, over [0, 1]

    subject to

        (t) = f(x(t), u(t)), t in [0, 1] a.e.,

        ϕ₋  ϕ(x(0), x(1))  ϕ₊, 

    where x(t)  R² and u(t)  R.


julia> solve(o, :exa, :madnlp)
▫ This is OptimalControl version v1.1.6 running with: direct, exa, madnlp.

▫ The optimal control problem is solved with CTDirect version v0.17.4.

   ┌─ The NLP is modelled with ExaModels and solved with MadNLP suite.
   │
   ├─ Number of time steps: 250
   └─ Discretisation scheme: midpoint

▫ This is MadNLP version v0.8.12, running with mumps

Number of nonzeros in constraint Jacobian............:     1754
Number of nonzeros in Lagrangian Hessian.............:     1000

Total number of variables............................:      753
                     variables with only lower bounds:        0
                variables with lower and upper bounds:        0
                     variables with only upper bounds:        0
Total number of equality constraints.................:      504
Total number of inequality constraints...............:        0
        inequality constraints with only lower bounds:        0
   inequality constraints with lower and upper bounds:        0
        inequality constraints with only upper bounds:        0

iter    objective    inf_pr   inf_du inf_compl lg(mu)  ||d||  lg(rg) alpha_du alpha_pr  ls
   0  5.0000000e-03 1.10e+00 3.96e-16 0.00e+00  -1.0 0.00e+00    -  0.00e+00 0.00e+00   0
   1  6.0000967e+00 3.20e-16 6.08e-04 0.00e+00  -1.0 6.08e+00  -4.0 1.00e+00 1.00e+00h  1
   2  6.0000960e+00 3.36e-12 1.27e-07 0.00e+00  -5.7 3.81e-03  -4.5 1.00e+00 1.00e+00h  1
   3  6.0000960e+00 2.13e-16 3.55e-10 0.00e+00  -8.6 3.20e-05  -5.0 1.00e+00 1.00e+00h  1

Number of Iterations....: 3

                                   (scaled)                 (unscaled)
Objective...............:   6.0000960015360283e+00    6.0000960015360283e+00
Dual infeasibility......:   3.5549475516094553e-10    3.5549475516094553e-10
Constraint violation....:   2.1337098754514727e-16    2.1337098754514727e-16
Complementarity.........:   0.0000000000000000e+00    0.0000000000000000e+00
Overall NLP error.......:   3.5549475516094553e-10    3.5549475516094553e-10

Number of objective function evaluations             = 4
Number of objective gradient evaluations             = 4
Number of constraint evaluations                     = 4
Number of constraint Jacobian evaluations            = 4
Number of Lagrangian Hessian evaluations             = 3
Total wall-clock secs in solver (w/o fun. eval./lin. alg.)  = 24.643
Total wall-clock secs in linear solver                      =  0.026
Total wall-clock secs in NLP function evaluations           =  0.000
Total wall-clock secs                                       = 24.670

EXIT: Optimal Solution Found (tol = 1.0e-08).
• Solver:
  ✓ Successful  : true
  │  Status     : SOLVE_SUCCEEDED
  │  Message    : MadNLP
  │  Iterations : 3
  │  Objective  : 6.000096001536028
  └─ Constraints violation : 2.1337098754514727e-16

• Boundary duals: [0.0, 0.0, 0.0, 0.0]

@jbcaillau
Copy link
Member Author

  • still some issues with compats
  • still need to add CTParser#develop explicitly when using it

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants